package com.anno;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.util.Enumeration;

//@WebServlet(urlPatterns = "/anno",loadOnStartup = 1,
//initParams = {@WebInitParam(name = "encoding",value = "UTF-8")})
@WebServlet(urlPatterns = "/anno", name = "anno")
public class Annotation extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("正在提供服务.....");

        Enumeration<String> names = this.getInitParameterNames();
        while (names.hasMoreElements()) {
            String s = names.nextElement();
            String parameter = this.getInitParameter(s);
            System.out.println(parameter);
        }
    }
}
